<template>
    <div>
        
        <i-table border stripe :columns="format" :data="show_list" height="780">
        </i-table >
    </div>
</template>

<script>

import { post } from  '@/api/http'
import { ceph_cluster_stat } from  '@/api'


export default {
    data() {
        return {
            format: [
                {
                    title: '集群ID',key: 'cluster_id',
                },
                {
                    title: '版本',key: 'version',
                },
                {
                    title: '容量(GB)',key: 'capacity',
                },
                {
                    title: '使用(GB)',key: 'used',
                },
                {
                    title: '剩余(GB)',key: 'avail',
                },
                {
                    title: '对象数量',key: 'num_objects',
                },
            ],
            show_list: [],

        }
    },
    methods: {
        refresh() {
            post(ceph_cluster_stat,undefined,undefined,3000).then( (response) => {
                // if(response.status==200){
                    let info = response.data
                    this.show_list = info
                // }
            }).catch(error =>{
                console.log(error)
            })
        }
    },
    mounted: function() {
        setTimeout(() =>{
            this.refresh();
        },200); 
    }
}
</script>
<style scoped>

</style>